#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 3005;
const int INF = 1e9;
int n, m, k;
int ans[N][N], cnt[N][N];
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> k;
  rep(i, 1, n) rep(j, 1, m) ans[i][j] = -1, cnt[i][j] = 0;
  queue<pii> q;
  rep(i, 1, k) {
    int x, y;
    cin >> x >> y;
    ans[x][y] = 0;
    q.push(pii(x, y));
  }
  while (q.size()) {
    int x = q.front().first, y = q.front().second;
    q.pop();
    rep(i, 0, 3) {
      int nx = x + dx[i], ny = y + dy[i];
      if (nx < 1 || nx > n || ny < 1 || ny > m) continue;
      if (++cnt[nx][ny] == 2 && ans[nx][ny] == -1) {
        ans[nx][ny] = ans[x][y] + 1;
        q.push(pii(nx, ny));
      }
    }
  }
  ll sum = 0;
  rep(i, 1, n) rep(j, 1, m) sum += max(0, ans[i][j]);
  cout << sum;
  return 0;
}